<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看审批')"/>
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">id</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="${repair.id}" name="id">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备名称</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="${repair.deviceName}" readonly class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">制造公司</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="${repair.deviceCompany}" readonly class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">申请金额</label>
                    <div class="layui-input-block" style="width: 150px">
                        <input type="text" th:value="${repair.devicePrice}" readonly class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">申请时间</label>
                    <div class="layui-input-block" style="width: 150px">
                        <input type="text" th:value="${repair.createTime}" readonly class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备分类</label>
                    <block th:if="${repair.sort} eq 0">
                        <a class="pear-btn pear-btn-warming pear-btn-sm" style="cursor:default"> 办公类设备 </a>
                    </block>
                    <block th:if="${repair.sort} eq 1">
                        <a class="pear-btn pear-btn-primary pear-btn-sm" style="cursor:default"> 科研类设备 </a>
                    </block>
                    <block th:if="${repair.sort} eq 2">
                        <a class="pear-btn pear-btn-danger pear-btn-sm" style="cursor:default"> 其他类设备 </a>
                    </block>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">申请状态</label>
                    <block th:if="${repair.status} eq 0">
                        <a class="pear-btn pear-btn-primary pear-btn-sm" style="cursor:default">
                            待 维 修
                        </a>
                    </block>
                    <block th:if="${repair.status} eq 1">
                        <a class="pear-btn pear-btn-warming pear-btn-sm" style="cursor:default">
                            维 修 中
                        </a>
                    </block>
                    <block th:if="${repair.status} eq 2">
                        <a class="pear-btn pear-btn-success pear-btn-sm" style="cursor:default">
                            维修成功
                        </a>
                    </block>
                    <block th:if="${repair.status} eq 3">
                        <a class="pear-btn pear-btn-success pear-btn-sm" style="cursor:default">
                            维修失败
                        </a>
                    </block>
                </div>

                <div class="layui-form-item">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                        <legend>维修流程</legend>
                    </fieldset>
                    <table class="layui-table" lay-skin="line">
                        <thead>
                        <tr>
                            <th>执行人</th>
                            <th>执行时间</th>
                            <th>执行结果</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="repair:${repairList}">
                            <td th:text="${repair.createName}"></td>
                            <td th:text="${repair.createTime}"></td>
                            <td th:text="${repair.remark}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">

            <button type="button" class="pear-btn pear-btn pear-btn-sm" onclick="myclose();"><i
                    class="layui-icon layui-icon-ok"></i> 返回
            </button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>

<script th:inline="javascript">
    layui.use(['form', 'jquery'], function () {

        window.myclose = function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
            parent.layui.table.reload("user-table");
        }

    })
</script>
</body>
</html>